# Contributor: Martin Schmidt <martin.schmidt13@gmx.de>
# Maintainer: Martin Schmidt <martin.schmidt13@gmx.de>
pkgname=mediastreamer2-plugin-openh264
pkgver=5.2.0_git20231020
_commit=ed96173dc74ca48e700cafea53f1d49575d84c70
pkgrel=0
pkgdesc="An H.264 encoder/decoder plugin for mediastreamer2 based on the openh264 library"
url="https://gitlab.linphone.org/BC/public/msopenh264"
arch="all"
license="GPL-2.0-or-later"
options="!check" # no test available
makedepends="
	bctoolbox-dev
	cmake
	mediastreamer2-dev
	openh264-dev
	ortp-dev
	samurai
	"
source="$pkgname-$_commit.tar.gz::https://gitlab.linphone.org/BC/public/msopenh264/-/archive/$_commit.tar.gz"
builddir="$srcdir/msopenh264-$_commit"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake \
		-DCMAKE_SKIP_INSTALL_RPATH=ON \
		-DBUILD_SHARED_LIBS=YES

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="
c4487675b7ea16ed4a967d0cbc0a9c3e8aff8e0832805b9a3fb2f38d836008663f68c37253f04d04237b306e709c357e19c34598242cc9fcdbe7bbdce57e9d3c  mediastreamer2-plugin-openh264-ed96173dc74ca48e700cafea53f1d49575d84c70.tar.gz
"
